package cn.stylefeng.guns.sys.modular.system.controller;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.sys.modular.system.model.params.BtyZxFeiyongfentanParam;
import cn.stylefeng.guns.sys.modular.system.service.BtyZxFeiyongfentanService;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/btyFentanBxd")
public class BtyFentanBxdController {

    private String PREFIX = "modular/system/btyFentanBxd";

    @Autowired
    private BtyZxFeiyongfentanService btyZxFeiyongfentanService;

    /**
     * 跳转到主页面
     *
     * @author
     * @Date 2021-08-30
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "/btyFentanBxd.html";
    }

    /**
     * 生成报销单
     *
     * @author
     */
    @RequestMapping("/addBxd")
    @ResponseBody
    public ResponseData addBxd(BtyZxFeiyongfentanParam param) {
        return btyZxFeiyongfentanService.addBxd(param);
    }

    /**
     * 撤回报销单
     *
     * @author
     */
    @RequestMapping("/rebutBxd")
    @ResponseBody
    public ResponseData rebutBxd(BtyZxFeiyongfentanParam param) {
        //status = 6才可删除
        return btyZxFeiyongfentanService.rebutBxd(param);
    }


    /**
     * 查询列表
     *
     * @author
     * @Date 2021-08-30
     */
    @ResponseBody
    @RequestMapping("/list")
    public LayuiPageInfo list(BtyZxFeiyongfentanParam btyZxFeiyongfentanParam) {

        return this.btyZxFeiyongfentanService.listBxd(btyZxFeiyongfentanParam);
    }
}
